<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"
    />
    <title>后台管理系统</title>
    <link href="/MeAdmin/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"
    />
    <!--[if lt IE 9]>
    <link rel="stylesheet" type="text/css" href="/MeAdmin/plugins/jquery-ui/jquery.ui.1.10.2.ie.css"
    />
    <![endif]-->
    <link href="/MeAdmin/assets/css/main.css" rel="stylesheet" type="text/css"/>
    <link href="/MeAdmin/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
    <link href="/MeAdmin/assets/css/responsive.css" rel="stylesheet" type="text/css"
    />
    <link href="/MeAdmin/assets/css/icons.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="/MeAdmin/assets/css/fontawesome/font-awesome.min.css">
    <!--[if IE 7]>
    <link rel="stylesheet" href="/MeAdmin/assets/css/fontawesome/font-awesome-ie7.min.css">
    <![endif]-->
    <!--[if IE 8]>
    <link href="/MeAdmin/assets/css/ie8.css" rel="stylesheet" type="text/css"/>
    <![endif]-->
    <!--<link href='http://fonts.useso.com/css?family=Open+Sans:400,600,700'-->
    <!--rel='stylesheet' type='text/css'>-->
    <script type="text/javascript" src="/MeAdmin/assets/js/libs/jquery-1.10.2.min.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/plugins/jquery-ui/jquery-ui-1.10.2.custom.min.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/bootstrap/js/bootstrap.min.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/assets/js/libs/lodash.compat.min.js">
    </script>
    <!--[if lt IE 9]>
    <script src="/MeAdmin/assets/js/libs/html5shiv.js">
    </script>
    <![endif]-->
    <script type="text/javascript" src="/MeAdmin/plugins/touchpunch/jquery.ui.touch-punch.min.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/plugins/event.swipe/jquery.event.move.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/plugins/event.swipe/jquery.event.swipe.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/assets/js/libs/breakpoints.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/plugins/respond/respond.min.js">
    </script>
    {{--<script type="text/javascript" src="/MeAdmin/plugins/cookie/jquery.cookie.min.js">--}}
    {{--</script>--}}
    <script type="text/javascript" src="/MeAdmin/plugins/slimscroll/jquery.slimscroll.min.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/plugins/slimscroll/jquery.slimscroll.horizontal.min.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/plugins/sparkline/jquery.sparkline.min.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/plugins/pickadate/picker.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/plugins/pickadate/picker.date.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/plugins/blockui/jquery.blockUI.min.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/plugins/fileinput/fileinput.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/plugins/uniform/jquery.uniform.min.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/plugins/select2/select2.min.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/assets/js/app.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/assets/js/plugins.js">
    </script>
    <script type="text/javascript" src="/MeAdmin/assets/js/plugins.form-components.js">
    </script>
    <script src="{{$static_url}}/js/layer/layer.js"></script>
    <script>
        $(document).ready(function () {
            App.init();
            Plugins.init();
            FormComponents.init();
        });
        var noAccessMsg = '你没有权限进行该操作，请与管理员联系';
        var otherErrorMsg = "未知错误信息";
    </script>
    <script type="text/javascript" src="/MeAdmin/assets/js/custom.js">
    </script>
    <style>
        body {
            font-family: "微软雅黑"
        }

        .td-actions {
            text-align: right
        }
        .margin-top-10{ margin-top: 10px}

        .th-5{width: 5%}
        .th-10{width: 10%}
        .th-20{width: 20%}
        .th-30{width: 30%}
        .th-40{width: 40%}
        .th-50{width: 50%}
        .th-60{width: 60%}
        .th-70{width: 70%}
        .th-80{width: 80%}
        .th-90{width: 90%}
    </style>
    @yield('page-header')
    @yield('page-cssjs')
</head>

<body>
<header class="header navbar navbar-fixed-top" role="banner">
    <div class="container">
        <ul class="nav navbar-nav">
            <li class="nav-toggle">
                <a href="javascript:void(0);" title="">
                    <i class="icon-reorder">
                    </i>
                </a>
            </li>
        </ul>
        <a class="navbar-brand" href="#">
            <strong>
                后台管理系统
            </strong>

        </a>
        <a href="#" class="toggle-sidebar bs-tooltip" data-placement="bottom"
           data-original-title="Toggle navigation">
            <i class="icon-reorder">
            </i>
        </a>
        <ul class="nav navbar-nav navbar-right">
            <li class="dropdown user">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    <i class="icon-male">
                    </i>
                    <span class="username">
                Admin
              </span>
                    <i class="icon-caret-down small">
                    </i>
                </a>
                <ul class="dropdown-menu">
                    <li>
                        <a href="{{URL::route('manage_login_out')}}">
                            <i class="icon-key">
                            </i>
                            退出
                        </a>
                    </li>
                </ul>
            </li>
        </ul>
    </div>

</header>
<div id="container">
    <div id="sidebar" class="sidebar-fixed">
        <div id="sidebar-content">
            <ul id="nav">
                <li>
                    <a href="{{URL::route('manage_index')}}"><i class="icon-dashboard"></i> 首页</a>
                </li>
                @foreach($userMenu as $val)
                    @if(isset($val->childMenu))
                        <li>
                            <a href="#" id="first_menu_area_{{$val->id}}">
                                <i class=" {{$val->class}}">
                                </i>
                                {{$val->name}}
                            </a>
                            <ul class="sub-menu" id="child_menu_area_{{$val->id}}">
                                @foreach($val->childMenu as $son)
                                    <li>
                                        <a href="javascript:;" id="child_menu_{{$son->id}}"
                                           onclick="openChildMenu('{{$son->id}}','{{$son->group_id}}','{{$son->url}}')">
                                            <i class="icon-angle-right">
                                            </i>
                                            {{$son->name}}
                                        </a>
                                    </li>
                                @endforeach
                            </ul>
                        </li>
                    @endif
                @endforeach
            </ul>
        </div>
        <div id="divider" class="resizeable">
        </div>
    </div>
    <div id="content">
        <div class="container">
            <div class="crumbs">
                <ul id="breadcrumbs" class="breadcrumb">
                    <li>
                        <i class="icon-home"></i>
                        <a href="{{URL::route('manage_index')}}">首页</a>
                    </li>

                    @yield('page-breadcrumbs')
                </ul>
                <ul class="crumb-buttons">
                    @yield('page-buttons')
                </ul>
            </div>
            <div class="page-header">
                <div class="page-title">
                    @yield('page-title')
                </div>
            </div>
            <div class="row" style="margin-bottom: 10px">
                @yield('page-tool')
            </div>
            <div class="row">
                <div class="col-md-12">
                    @yield('page-content')
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    $('.datepicker').pickadate({
        weekdaysShort: ['日', '一', '二', '三', '四', '五', '六'],
        monthsFull: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
        monthsShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
        format: 'yyyy-mm-dd',
        today: '今天',
        clear: '清空',
        close: '关闭',
        selectYears: false,
        selectMonths: false
    });

    $(document).ready(function () {
        var childMenuId = getCookie('childMenuId');
        var firstMenuId = getCookie('firstMenuId');
        if (childMenuId != '' && firstMenuId != '') {
            $('#first_menu_area_' + firstMenuId).append('<i class="arrow icon-angle-down"></i>');
            $('#child_menu_area_' + firstMenuId).css('display','block');
            $('#child_menu_' + childMenuId).css('background-color','#CCCCCC');
            $('#first_menu_area_' + firstMenuId).find("i").eq(1).remove();
        }
    });

    function openChildMenu(childMenuId, firstMenuId, url) {
        setCookie('childMenuId', childMenuId);
        setCookie('firstMenuId', firstMenuId);
        window.location.href = url;

    }


    function setCookie(name,value,expiredays){
        var exdate=new Date()
        exdate.setDate(exdate.getDate()+expiredays)
        document.cookie=name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString())+";path=/";

    }

    function getCookie(name){
        var strcookie=document.cookie;
        var arrcookie=strcookie.split("; ");
        for(var i=0;i<arrcookie.length;i++){
            var arr=arrcookie[i].split("=");
            if(arr[0]==name)return arr[1];
        }
        return "";
    }



</script>
@yield('page-scripts')
</html>